/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import entity.Customer;
import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author admin
 */
public class TableCustomer extends AbstractTableModel {

    public static ArrayList<Customer> customer;
    private final String columnName[] = {"ID", "Full Name", "User Name","Departmental", "Gender", "Age", "Address", "Phone", "Email", "Status"};
    private final Class columnClass[] = {int.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class};

    public TableCustomer(ArrayList<Customer> customer) {
        this.customer = customer;
    }

    public TableCustomer() {
        customer = new ArrayList<Customer>();
    }

    @Override
    public int getRowCount() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public int getColumnCount() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String getColumnName(int column) {
        return columnName[column];
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        switch (columnIndex) {
            case 1:
                return customer.get(rowIndex).getId();
            case 2:
                return customer.get(rowIndex).getFullName();
            case 3:
                return customer.get(rowIndex).getUserName();
            case 4:
                return customer.get(rowIndex).getDepartmental();
            case 5:
                return customer.get(rowIndex).getGender();
            case 6:
                return customer.get(rowIndex).getAge();
            case 7:
                return customer.get(rowIndex).getAddress();
            case 8:
                return customer.get(rowIndex).getPhone();
            case 9:
                return customer.get(rowIndex).getEmail();
            case 10:
                return customer.get(rowIndex).getStatus();
            default:
                return null;
        }
    }
}
